package com.ahao.platform;


import android.app.Activity;
import android.app.Application;
import android.content.Context;
import android.content.Intent;
import android.content.res.Configuration;
import android.os.Bundle;
import android.view.KeyEvent;
import com.ahao.abstraction.BaseChannel;
import com.ahao.abstraction.ILifeCycle;
import com.ahao.abstraction.ISDKListener;
import com.ahao.abstraction.PayParams;
import com.ahao.abstraction.RoleInfoParams;
import com.ahao.sdk.AHAOPlatformSDKManager;

public class AHAOSDK extends BaseChannel implements ILifeCycle {

    @Override
    public void login(Context context) {
        super.login(context);
        AHAOPlatformSDKManager.getInstance().login(context);
    }

    @Override
    public void pay(Context context, PayParams payParams) {
        super.pay(context, payParams);
        AHAOPlatformSDKManager.getInstance().pay(context, payParams);
    }

    @Override
    public void init(Activity activity, ISDKListener isdkListener) {
        super.init(activity, isdkListener);
        AHAOPlatformSDKManager.getInstance().init(activity, isdkListener);
    }

    @Override
    public void initApplication(Application application) {
        super.initApplication(application);
        AHAOPlatformSDKManager.getInstance().initApplication(application);
    }

    @Override
    public void uploadRoleInfo(Context context, RoleInfoParams roleInfoParams) {
        AHAOPlatformSDKManager.getInstance().uploadRoleInfo(context, roleInfoParams);
    }

    @Override
    public ILifeCycle getLifeCycle() {
        return this;
    }

    @Override
    public void onStart() {
        AHAOPlatformSDKManager.getInstance().onStart();
    }

    @Override
    public void onPause() {
        AHAOPlatformSDKManager.getInstance().onPause();
    }

    @Override
    public void onResume() {
        AHAOPlatformSDKManager.getInstance().onResume();
    }

    @Override
    public void onNewIntent(Intent intent) {
        AHAOPlatformSDKManager.getInstance().onNewIntent(intent);
    }

    @Override
    public void onStop() {
        AHAOPlatformSDKManager.getInstance().onStop();
    }

    @Override
    public void onDestroy() {
        AHAOPlatformSDKManager.getInstance().onDestroy();
    }

    @Override
    public void onRestart() {
        AHAOPlatformSDKManager.getInstance().onRestart();
    }

    @Override
    public void onConfigurationChanged(Configuration newConfig) {
        AHAOPlatformSDKManager.getInstance().onConfigurationChanged(newConfig);
    }

    @Override
    public void onSaveInstanceState(Bundle outState) {
        AHAOPlatformSDKManager.getInstance().onSaveInstanceState(outState);
    }

    @Override
    public void onActivityResult(int requestCode, int resultCode, Intent data) {
        AHAOPlatformSDKManager.getInstance().onActivityResult(requestCode, resultCode, data);
    }

    @Override
    public void onBackPressed() {
        AHAOPlatformSDKManager.getInstance().onBackPressed();
    }

    @Override
    public boolean onKeyDown(int keyCode, KeyEvent event) {
        return AHAOPlatformSDKManager.getInstance().onKeyDown(keyCode, event);
    }

    @Override
    public void onRequestPermissionsResult(int requestCode, String[] permissions, int[] grantResults) {
        AHAOPlatformSDKManager.getInstance().onRequestPermissionsResult(requestCode, permissions, grantResults);
    }
}
